﻿using PersistentObject.Common.Exceptions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace PersistentObject.Common.Attributes
{
    /// <summary>
    /// Indicate the property as the primary key
    /// </summary>
    [AttributeUsage(AttributeTargets.Property)]
    public class KeyAttribute : Attribute
    {
        /// <summary>
        /// The constructor of Key attribute which requires the type of IKeyGenerator
        /// </summary>
        public KeyAttribute()
        {
            IsIdentity = true;
        }

        public KeyAttribute(bool isIdentity)
        {
            IsIdentity = isIdentity;
        }

        public bool IsIdentity { get; set; }
    }
}
